//
//  HomeTableViewController.swift
//  CXSwiftWB
//
//  Created by CaoXuan on 2017/5/7.
//  Copyright © 2017年 meidaer. All rights reserved.
//

import UIKit

class HomeTableViewController: BaseTableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
//        if !isLogin
//        {
//            // 设置访辅助视图
//            visitorView?.setupVisitorInfo(nil, title: "暂时还没有添加用户")
//            return
//        }
        
        navigationController?.navigationBar.tintColor = UIColor.orange
        // 注册通知
        NotificationCenter.default.addObserver(self, selector: #selector(prsentTopVC), name:Notification.Name(rawValue: XMGPresentationManagerDidPresented) , object: nil)
        
        NotificationCenter.default.addObserver(self, selector: #selector(dismissTopVC), name:Notification.Name(rawValue: XMGPresentationManagerDidDismissed) , object: nil)
        
        setUpNav()
        
        // swift
        DispatchQueue.main.asyncAfter(deadline: .now() + 5) { 
            
        }
        
    }
    
    deinit {
        NotificationCenter.default.removeObserver(self)
    }


    // MARK: - 辅助方法
    func prsentTopVC() {
        
    }
    
    func dismissTopVC() {
        
    }
    
    func leftItmClick() {
        
    }
    
    func rightItemClick() {
        let sb = UIStoryboard(name: "QRCode", bundle: nil)
        let vc = sb.instantiateInitialViewController()
        present(vc!, animated: true, completion: nil)
    }
    
    func setUpNav() {
        // navigationbar_friendattention  navigationbar_pop
        navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage.init(named: "navigationbar_pop"), style: .done, target: self, action: #selector(rightItemClick))
        navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage.init(named: "navigationbar_friendattention"), style: .done, target: self, action: #selector(leftItmClick))
    }

}
